import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useScoreStore = defineStore('score', () => {
    const scores = ref([
        {
            id: 1,
            studentName: "张三",
            subject: "数学",
            score: 95
        },
        {
            id: 2,
            studentName: "李四",
            subject: "语文",
            score: 88
        },
        {
            id: 3,
            studentName: "王五",
            subject: "英语",
            score: 92
        }
    ])

    // 你可以根据需要添加更多操作方法
    function addScore(newScore: { id: number, studentName: string, subject: string, score: number }) {
        scores.value.push(newScore)
    }

    return { scores, addScore }
})